const jwt = require("jwt-simple")
const KEY = "web0213"
module.exports = {
  encode(id) {
    return jwt.encode(
      {
        id,
        expires: Date.now() + 1000 * 60 * 60,
      },
      KEY
    )
  },
  decode(token) {
    return jwt.decode(token, KEY)
  },
}
